import React, { Component } from 'react'
import './index.css'
export default class Active extends Component {
  render() {
    const { isFirst, islogding, err, users } = this.props
    return (
      <div className="row">
        {isFirst ? (
          <h1>自助者得天助</h1>
        ) : islogding ? (
          <h1>logding....</h1>
        ) : err ? (
          <h1>{err}</h1>
        ) : (
          users.map((item) => {
            return (
              <div key={item.id} className="card">
                <a href={item.html_url} target="_blank" rel="noreferrer">
                  <img
                    src={item.avatar_url}
                    alt=""
                    style={{ width: '100px' }}
                  />
                </a>
                <p className="card-text">{item.login}</p>
              </div>
            )
          })
        )}
      </div>
    )
  }
}
